package cn.jarlen.jwt.tools.crypt.base;

public class CryptoAppKitProperties {
    private static final CryptoAppKitProperties CRYPTO_APP_KIT_PROPERTIES = new CryptoAppKitProperties();
    private CryptoAppKitProperties.UsbKey usbKey = new CryptoAppKitProperties.UsbKey();
    private CryptoAppKitProperties.Hsm hsm = new CryptoAppKitProperties.Hsm();
    private CryptoAppKitProperties.Svs svs = new CryptoAppKitProperties.Svs();
    private CryptoAppKitProperties.Soft soft = new CryptoAppKitProperties.Soft();
    private CryptoAppKitProperties.CertInfo certInfo = new CryptoAppKitProperties.CertInfo();
    private boolean useSvs = false;
    private int hsmType;

    public CryptoAppKitProperties() {
    }

    public static CryptoAppKitProperties getInstance() {
        return CRYPTO_APP_KIT_PROPERTIES;
    }

    public boolean isUseSvs() {
        return this.useSvs;
    }

    public void setUseSvs(boolean useSvs) {
        this.useSvs = useSvs;
    }

    public int getHsmType() {
        return this.hsmType;
    }

    public void setHsmType(int hsmType) {
        this.hsmType = hsmType;
    }

    public CryptoAppKitProperties.UsbKey getUsbKey() {
        return this.usbKey;
    }

    public CryptoAppKitProperties.UsbKey setUsbKey(CryptoAppKitProperties.UsbKey usbKey) {
        return this.usbKey = usbKey;
    }

    public CryptoAppKitProperties.Hsm getHsm() {
        return this.hsm;
    }

    public CryptoAppKitProperties.Hsm setHsm(CryptoAppKitProperties.Hsm hsm) {
        return this.hsm = hsm;
    }

    public CryptoAppKitProperties.Soft getSoft() {
        return this.soft;
    }

    public void setSoft(CryptoAppKitProperties.Soft soft) {
        this.soft = soft;
    }

    public CryptoAppKitProperties.Svs getSvs() {
        return this.svs;
    }

    public CryptoAppKitProperties.Svs setSvs(CryptoAppKitProperties.Svs svs) {
        return this.svs = svs;
    }

    public CryptoAppKitProperties.CertInfo getCertInfo() {
        return this.certInfo;
    }

    public CryptoAppKitProperties.CertInfo setCertInfo(CryptoAppKitProperties.CertInfo certInfo) {
        return this.certInfo = certInfo;
    }

    public static class CertInfo {
        private String rootCertPath;
        private int certValidityType;
        private String ldapIp;
        private String ldapPort;
        private String crlAttrName = "certificateRevocationList;binary";
        private String crlDn;
        private String ocspUrl;
        private String certChainFilePath;
        private String crlFileCachePath;

        public CertInfo() {
        }

        public String getRootCertPath() {
            return this.rootCertPath;
        }

        public void setRootCertPath(String rootCertPath) {
            this.rootCertPath = rootCertPath;
        }

        public int getCertValidityType() {
            return this.certValidityType;
        }

        public void setCertValidityType(int certValidityType) {
            this.certValidityType = certValidityType;
        }

        public String getLdapIp() {
            return this.ldapIp;
        }

        public void setLdapIp(String ldapIp) {
            this.ldapIp = ldapIp;
        }

        public String getLdapPort() {
            return this.ldapPort;
        }

        public void setLdapPort(String ldapPort) {
            this.ldapPort = ldapPort;
        }

        public String getCrlAttrName() {
            return this.crlAttrName;
        }

        public void setCrlAttrName(String crlAttrName) {
            this.crlAttrName = crlAttrName;
        }

        public String getCrlDn() {
            return this.crlDn;
        }

        public void setCrlDn(String crlDn) {
            this.crlDn = crlDn;
        }

        public String getOcspUrl() {
            return this.ocspUrl;
        }

        public void setOcspUrl(String ocspUrl) {
            this.ocspUrl = ocspUrl;
        }

        public String getCertChainFilePath() {
            return this.certChainFilePath;
        }

        public void setCertChainFilePath(String certChainFilePath) {
            this.certChainFilePath = certChainFilePath;
        }

        public String getCrlFileCachePath() {
            return this.crlFileCachePath;
        }

        public void setCrlFileCachePath(String crlFileCachePath) {
            this.crlFileCachePath = crlFileCachePath;
        }
    }

    public static class Soft {
        private String signKeyStoreFile;
        private String signKeyPasswd;
        private String encKeyStoreFile;
        private String encKeyPasswd;
        private String keyPath = "/home/xdja/cryptAppKit";

        public Soft() {
        }

        public String getSignKeyStoreFile() {
            return this.signKeyStoreFile;
        }

        public void setSignKeyStoreFile(String signKeyStoreFile) {
            this.signKeyStoreFile = signKeyStoreFile;
        }

        public String getSignKeyPasswd() {
            return this.signKeyPasswd;
        }

        public void setSignKeyPasswd(String signKeyPasswd) {
            this.signKeyPasswd = signKeyPasswd;
        }

        public String getEncKeyStoreFile() {
            return this.encKeyStoreFile;
        }

        public void setEncKeyStoreFile(String encKeyStoreFile) {
            this.encKeyStoreFile = encKeyStoreFile;
        }

        public String getEncKeyPasswd() {
            return this.encKeyPasswd;
        }

        public void setEncKeyPasswd(String encKeyPasswd) {
            this.encKeyPasswd = encKeyPasswd;
        }

        public String getKeyPath() {
            return this.keyPath;
        }

        public void setKeyPath(String keyPath) {
            this.keyPath = keyPath;
        }
    }

    public static class Svs {
        public Svs() {
        }
    }

    public static class Hsm {
        private int exchangeKeyIndex;
        private int signKeyIndex;
        private String appName;
        private String yunHsmSdkConfPath = "/usr/local/yunhsmsdk/conf/yunhsmsdk.conf";

        public Hsm() {
        }

        public int getExchangeKeyIndex() {
            return this.exchangeKeyIndex;
        }

        public void setExchangeKeyIndex(int exchangeKeyIndex) {
            this.exchangeKeyIndex = exchangeKeyIndex;
        }

        public int getSignKeyIndex() {
            return this.signKeyIndex;
        }

        public void setSignKeyIndex(int signKeyIndex) {
            this.signKeyIndex = signKeyIndex;
        }

        public String getYunHsmSdkConfPath() {
            return this.yunHsmSdkConfPath;
        }

        public void setYunHsmSdkConfPath(String yunHsmSdkConfPath) {
            this.yunHsmSdkConfPath = yunHsmSdkConfPath;
        }

        public String getAppName() {
            return this.appName;
        }

        public void setAppName(String appName) {
            this.appName = appName;
        }
    }

    public static class UsbKey {
        private int containerNum;
        private String usbPin = "111111";
        private int usbRole = 1;

        public UsbKey() {
        }

        public int getContainerNum() {
            return this.containerNum;
        }

        public void setContainerNum(int containerNum) {
            this.containerNum = containerNum;
        }

        public String getUsbPin() {
            return this.usbPin;
        }

        public void setUsbPin(String usbPin) {
            this.usbPin = usbPin;
        }

        public int getUsbRole() {
            return this.usbRole;
        }

        public void setUsbRole(int usbRole) {
            this.usbRole = usbRole;
        }
    }
}
